<?php

namespace App\Http\Requests\Api;

class ImageRequest extends ApiRequest
{
    public function rules()
    {
        return [
            'file' => 'bail|required|image|mimes:jpeg,bmp,png|max:' . (strval(1024 * 3)),//不能超过3M
        ];
    }

    public function attributes()
    {
        return [
            'file'=>'图片',
        ];
    }

    public function messages()
    {
        return array_merge(parent::messages(),[
            'file.max'=>'图片不能大于3M',
        ]);
    }
}
